home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon Block
- -- Original Carnage Contest Weapon
- -- Script by DC, August 2009, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.block={}
-
- -- Load & Prepare Ressources
- cc.block.gfx_wpn=loadgfx("buildings/block.bmp") -- Weapon Image
- setmidhandle(cc.block.gfx_wpn)
- cc.block.sfx_build=loadsfx("buildstone.ogg") -- Build Sound
-
- --------------------------------------------------------------------------------
- -- Weapon: Block
- --------------------------------------------------------------------------------
-
- cc.block.id=addweapon("cc.block","Block",cc.block.gfx_wpn,3) -- Add Weapon (3 uses)
-
- function cc.block.draw() -- Draw
- -- HUD Positioning
- if weapon_shots==0 then
- hudpositioning(pos_build,cc.block.gfx_wpn)
- end
- end
-
- function cc.block.attack(attack) -- Attack
- if (weapon_shots<=0) and (weapon_position==1) then
- -- Use weapon and allow to use another one afterwards (1)
- useweapon(1)
- weapon_shots=weapon_shots+1
- -- Draw
- terrainimage(cc.block.gfx_wpn,weapon_x,weapon_y)
- -- Sound
- playsound(cc.block.sfx_build)
- end
- end